# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=slock
pkgver=1.4
pkgrel=0
pkgdesc="A simple screen locker for X"
url="https://tools.suckless.org/slock/"
arch="all"
license="MIT"
makedepends="libxext-dev libxrandr-dev linux-headers"
options="suid"
subpackages="$pkgname-doc"
source="https://dl.suckless.org/tools/$pkgname-$pkgver.tar.gz"

# secfixes:
#   1.3-r3:
#     - CVE-2016-6866

prepare() {
	default_prepare
	sed -i -e '/CFLAGS/{s/-Os//;s/=/+=/}' \
		-e '/LDFLAGS/{s/-s//;s/=/+=/}' \
		"$builddir"/config.mk
}

build() {
	make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11 \
		-C "$builddir"
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" \
		-C "$builddir" install
}

sha512sums="ad285360dd3f16a225159abaf2f82fabf2c675bd74478cf717f68cbe5941a6c620e3c88544ce675ce3ff19af4bb0675c9405685e0f74ee4e84f7d34c61a0532f  slock-1.4.tar.gz"
